package com.dsg.controller.apply;


import com.dsg.common.dto.AjaxResult;
import com.dsg.common.util.UUIDGenerator;
import com.dsg.entity.apply.DsgApplyCheck;
import com.dsg.service.apply.IDsgApplyCheckService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import com.dsg.controller.base.BaseController;

/**
 * <p>
 * 對單記錄 前端控制器
 * </p>
 *
 * @author system
 * @since 2020-09-01
 */
@RestController
@RequestMapping("/apply/dsgApplyCheck")
public class DsgApplyCheckController extends BaseController {
    @Autowired
    IDsgApplyCheckService checkService;

    @PostMapping(value = "/toBeContinued")
    @ApiOperation("对单待跟进")
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult toBeContinued(@RequestBody DsgApplyCheck check) {
        check.setOid(UUIDGenerator.getUUID());
        checkService.save(check);
        return success();
    }
}
